package day03_Socket;

import java.io.*;
import java.net.Socket;

public class Socket_Clint {
    static Socket socket = null;

    public static void main(String[] args) {
        try {
            String tc = null;
            socket = new Socket("127.0.0.1",3232);
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            PrintWriter pw = new PrintWriter(socket.getOutputStream());

            Clint_Thread ct = new Clint_Thread(socket);
            ct.start();

            while(!(tc=br.readLine()).equals("exit")){
                System.out.println(tc);
                pw.println(tc);
                pw.flush();
            }
            pw.close();
            br.close();

        } catch (IOException e) {
            System.out.println("链接关闭");
        }


    }

}
